/* string容器 查找和替换 */
/*
10
10
15
16
1234567890QWERtyuiop
hello567890QWERtyuiop
*/
#include <iostream>
#include <string>

using namespace std;

int main(int argc, char **argv)
{
    string str1 = "QWER";
    string str = "1234567890qwertyuiop";

    /* 正着找 */
    cout << str.find("qwe") << endl;
    cout << str.find("qwe", 0, 2) << endl;
    cout << str.find('y') << endl;

    /* 反着找 */
    cout << str.rfind('u') << endl;

    /* 替换操作 */
    str.replace(10, 4, str1);
    cout << str << endl;

    str.replace(0, 4, "hello");
    cout << str << endl;

    return 0;
}